package com.pi.iot.repository.huawei.bean.notify;

import javax.validation.constraints.NotNull;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.pi.iot.repository.huawei.bean.notify.command.CommandResult;

/**
 * @description 华为iot返回的通知类
 * @author chenmfa
 *         {"notifyType":"deviceDataChanged","deviceId":"25506f88-2563-4a3f-8976-ec312a5dd954","gatewayId":"25506f88-2563-4a3f-8976-ec312a5dd954","requestId":null,"service":{"serviceId":"Message","serviceType":"Message","data":{"msgTime":1543237956,"msgType":2,"userId":"0\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000"},"eventTime":"20181126T160053Z"}}
 */
public class HuaWeiIotRecord {
  @NotNull(message = "IOT_NOTIFY.NOTIFY_TYPE_IS_EMPTY")
  private String notifyType;
  @NotNull(message = "IOT_NOTIFY.DEV_ID_IS_EMPTY")
  private String deviceId;
  private String gatewayId;
  private String requestId;
  private String commandId;
  private JSONObject service;
  private JSONArray services;
  private CommandResult result;

  public String getNotifyType() {
    return notifyType;
  }

  public void setNotifyType(String notifyType) {
    this.notifyType = notifyType;
  }

  public String getDeviceId() {
    return deviceId;
  }

  public void setDeviceId(String deviceId) {
    this.deviceId = deviceId;
  }

  public String getGatewayId() {
    return gatewayId;
  }

  public void setGatewayId(String gatewayId) {
    this.gatewayId = gatewayId;
  }

  public String getRequestId() {
    return requestId;
  }

  public void setRequestId(String requestId) {
    this.requestId = requestId;
  }

  public String getCommandId() {
    return commandId;
  }

  public void setCommandId(String commandId) {
    this.commandId = commandId;
  }

  public JSONObject getService() {
    return service;
  }

  public void setService(JSONObject service) {
    this.service = service;
  }

  public JSONArray getServices() {
    return services;
  }

  public void setServices(JSONArray services) {
    this.services = services;
  }

  public CommandResult getResult() {
    return result;
  }

  public void setResult(CommandResult result) {
    this.result = result;
  }

  @Override
  public String toString() {
    return JSON.toJSONString(this);
  }
}
